import { lazy } from "react";

import Home from "../pages/home/Index";
import Login from "../pages/login/Index";
import Color from "../pages/color/Index";
import { Navigate } from "react-router-dom";
let Index = lazy(() => import("../pages/index/Index"));
let User = lazy(() => import("../pages/user/Index"));
let Indexx = lazy(() => import("../pages/index/indexx/Index"));
let Styles = lazy(() => import("../pages/index/styles/Index"));
export const homee = [
  {
    path: "/home/index",
    element: <Index></Index>,
    title: "路由权限",
    children: [
      {
        path: "/home/index/indexx",
        element: <Indexx></Indexx>,
        title: "首页1",
      },
      {
        path: "/home/index/styles",
        element: <Styles></Styles>,
        title: "首页2",
      },
    ],
  },
  {
    path: "/home/user",
    element: <User></User>,
    title: "后台管理",
  },
];

const home = [
  {
    path: "/",
    element: <Navigate to={"/home"}></Navigate>,
  },
  {
    path: "/home",
    element: <Home></Home>,
    children: homee,
  },
  {
    path: "/color",
    element: <Color></Color>,
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "/user",
    element: <User></User>,
  },
];
export default home;
